  <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%--
  Created by IntelliJ IDEA.
  User: cnc
  Date: 2017-06-22
  Time: 10:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
    <style>
        .rowStyles{width:120px;height:35px;overflow: hidden;}

        .searchDiv{
            height: 150px;
            position: absolute;
            overflow:auto;
            z-index: 999;
            top:35px;
            right: 53px;
            background-color: #fff ;
            border-bottom:1px solid #CCCCCC;
            border-left: 1px solid #CCCCCC;
            border-right: 1px solid #CCCCCC;
            border-radius: 2px;
            clear:both;
        }
        .searchList{
            width: 100%;
            height: 100%;
            padding: 0;
            margin: 0;
            list-style:none;
        }
        .searchList li{
            padding-top: 5px;
            padding-bottom: 5px;
            cursor: pointer;
            display: block;
            box-sizing: border-box;
            border-bottom: 1px solid #CCCCCC;
        }
        .searchList li:hover{
            background-color: #CCCCCC;
        }
        .searchListlia{
            width: 90%;
            padding-left: 5px;
            float: left;
        }
        .searchList li span{
            width: 10%;
        }
        .datagrid-row {
            height: 42px;
            text-align:center;
        }
    </style>
    <jsp:include page="../head.jsp"/>
</head>
<body>
    <input type="hidden" value="${map.type}" id="contentType">
    <input type="hidden" value="${map.contentType}" id="contentTypeZh">
    <div class="topbar">
      <div class="form-group">
          <div class="col-sm-6">
                <shiro:hasPermission name="/${map.type}/add">
                <div  class="sys_button" id="newContent"><span class="sys_icon sys_icon_add">&nbsp;</span>新建${map.contentType}</div>
                </shiro:hasPermission>
                <shiro:hasPermission name="/${map.type}/update">
                <div  class="sys_button" id="modifyContent"><span class="sys_icon sys_icon_modify"></span>修改${map.contentType}</div>
                </shiro:hasPermission>
                <shiro:hasPermission name="/${map.type}/delete">
                <div  class="sys_button" id="deleteContent"><span class="sys_icon sys_icon_delete">&nbsp;</span>删除${map.contentType}</div>
                </shiro:hasPermission>
                <shiro:hasPermission name="/${map.type}/update">
                <div  class="sys_button" id="saveContent"><span class="sys_icon sys_icon_save">&nbsp;</span>保存</div>
                </shiro:hasPermission>
          </div>
          <div class="col-sm-5">
              <div class="input-daterange input-group" id="range-datepicker"  style="margin-top: 15px;">
                    <input id="searchContent" name="searchContent" type="text" class="form-control">
                    <span id="searchBtn"  type="button" class="input-group-addon btn btn-primary">搜索</span>
                    <div id="searchDivChioce" class="searchDiv">
                    </div>
              </div>
          </div>
      </div>
  </div>
    <div style="height: 91%">
        <div id="datetabs" class="easyui-tabs"data-options="fit:true,border:false">
            <div title="${map.contentType}列表" >
                <table id = "listArticleTable" data-options="fit:true,border:false"></table>
            </div>
        </div>
    </div>

    <!-- 展示具体内容。Dialog -->
    <div id="blogContentDialog" class="easyui-dialog" data-options="closed:'true',modal:true" style="height: 650px;width: 850px">
        <div id = "contentInfo" style="overflow:auto;">

        </div>
    </div>
</body>

<jsp:include page="../footer.jsp"/>
<script src="${pageContext.request.contextPath}/static/blogAdmin/blog/js/nicEdit.js" ></script>
<script src="${pageContext.request.contextPath}/static/blogAdmin/sys/js/blog/blog_article_index.js"></script>
<script type="text/javascript">
    function addArea(value) {
        {buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image']}
        return new nicEditor({fullPanel : true,iconsPath :'${pageContext.request.contextPath}/static/blogAdmin/blog/js/nicEditorIcons.gif'}).panelInstance(value);
    }
    document.onkeydown = function() {
        if (event.keyCode == 9) {  //如果是其它键，换上相应在ascii 码即可。
            return false; //非常重要
        }
    }
    //    $("#getContent").click(function (){
    //        console.log($(".nicEdit-main").html());
    //    })
</script>
<script>
    changeWidth();
    window.onresize = function(){
        changeWidth();
    }
    function changeWidth(){
        var inputWidth = $("#searchContent").width();
        $("#searchDivChioce").width(inputWidth+24);
    }
</script>
</html>
